home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Tool Chest / Interfaces / UniversalInterfaces 2.0 / CIncludes / EPPC.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-18  |  4.7 KB  |  172 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        EPPC.h
  3.  
  4.      Contains:    High Level Event Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.0 in “MPW Latest” on ETO #17
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __EPPC__
  21. #define __EPPC__
  22.  
  23.  
  24. #ifndef __ERRORS__
  25. #include <Errors.h>
  26. #endif
  27. /*    #include <ConditionalMacros.h>                                */
  28.  
  29. #ifndef __APPLETALK__
  30. #include <AppleTalk.h>
  31. #endif
  32. /*    #include <Types.h>                                            */
  33. /*    #include <OSUtils.h>                                        */
  34. /*        #include <MixedMode.h>                                    */
  35. /*        #include <Memory.h>                                        */
  36.  
  37. #ifndef __FILES__
  38. #include <Files.h>
  39. #endif
  40.  
  41. #ifndef __PPCTOOLBOX__
  42. #include <PPCToolbox.h>
  43. #endif
  44.  
  45. #ifndef __PROCESSES__
  46. #include <Processes.h>
  47. #endif
  48. /*    #include <Events.h>                                            */
  49. /*        #include <Quickdraw.h>                                    */
  50. /*            #include <QuickdrawText.h>                            */
  51.  
  52. #ifndef __EVENTS__
  53. #include <Events.h>
  54. #endif
  55.  
  56. #ifdef __cplusplus
  57. extern "C" {
  58. #endif
  59.  
  60. #if PRAGMA_ALIGN_SUPPORTED
  61. #pragma options align=mac68k
  62. #endif
  63.  
  64. #if PRAGMA_IMPORT_SUPPORTED
  65. #pragma import on
  66. #endif
  67.  
  68.  
  69. enum {
  70.     kHighLevelEvent                = 23,
  71. /* postOptions currently supported */
  72.     receiverIDMask                = 0x0000F000,
  73.     receiverIDisPSN                = 0x00008000,
  74.     receiverIDisSignature        = 0x00007000,
  75.     receiverIDisSessionID        = 0x00006000,
  76.     receiverIDisTargetID        = 0x00005000,
  77.     systemOptionsMask            = 0x00000F00,
  78.     nReturnReceipt                = 0x00000200,
  79.     priorityMask                = 0x000000FF,
  80.     nAttnMsg                    = 0x00000001,
  81. /* constant for return receipts */
  82.     HighLevelEventMsgClass        = 'jaym',
  83.     rtrnReceiptMsgID            = 'rtrn',
  84.     msgWasPartiallyAccepted        = 2,
  85.     msgWasFullyAccepted            = 1,
  86.     msgWasNotAccepted            = 0
  87. };
  88.  
  89. struct TargetID {
  90.     long                            sessionID;
  91.     PPCPortRec                        name;
  92.     LocationNameRec                    location;
  93.     PPCPortRec                        recvrName;
  94. };
  95. typedef struct TargetID TargetID;
  96.  
  97. typedef TargetID *TargetIDPtr, **TargetIDHandle, **TargetIDHdl;
  98.  
  99. typedef TargetID SenderID;
  100.  
  101. typedef SenderID *SenderIDPtr;
  102.  
  103. struct HighLevelEventMsg {
  104.     unsigned short                    HighLevelEventMsgHeaderLength;
  105.     unsigned short                    version;
  106.     unsigned long                    reserved1;
  107.     EventRecord                        theMsgEvent;
  108.     unsigned long                    userRefcon;
  109.     unsigned long                    postingOptions;
  110.     unsigned long                    msgLength;
  111. };
  112. typedef struct HighLevelEventMsg HighLevelEventMsg;
  113.  
  114. typedef HighLevelEventMsg *HighLevelEventMsgPtr, **HighLevelEventMsgHandle, **HighLevelEventMsgHdl;
  115.  
  116. typedef pascal Boolean (*GetSpecificFilterProcPtr)(void *yourDataPtr, HighLevelEventMsgPtr msgBuff, const TargetID *sender);
  117.  
  118. #if GENERATINGCFM
  119. typedef UniversalProcPtr GetSpecificFilterUPP;
  120. #else
  121. typedef GetSpecificFilterProcPtr GetSpecificFilterUPP;
  122. #endif
  123.  
  124. enum {
  125.     uppGetSpecificFilterProcInfo = kPascalStackBased
  126.          | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
  127.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(void*)))
  128.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(HighLevelEventMsgPtr)))
  129.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(TargetID*)))
  130. };
  131.  
  132. #if GENERATINGCFM
  133. #define NewGetSpecificFilterProc(userRoutine)        \
  134.         (GetSpecificFilterUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppGetSpecificFilterProcInfo, GetCurrentArchitecture())
  135. #else
  136. #define NewGetSpecificFilterProc(userRoutine)        \
  137.         ((GetSpecificFilterUPP) (userRoutine))
  138. #endif
  139.  
  140. #if GENERATINGCFM
  141. #define CallGetSpecificFilterProc(userRoutine, yourDataPtr, msgBuff, sender)        \
  142.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppGetSpecificFilterProcInfo, (yourDataPtr), (msgBuff), (sender))
  143. #else
  144. #define CallGetSpecificFilterProc(userRoutine, yourDataPtr, msgBuff, sender)        \
  145.         (*(userRoutine))((yourDataPtr), (msgBuff), (sender))
  146. #endif
  147.  
  148. extern pascal OSErr PostHighLevelEvent(const EventRecord *theEvent, unsigned long receiverID, unsigned long msgRefcon, Ptr msgBuff, unsigned long msgLen, unsigned long postingOptions)
  149.  THREEWORDINLINE(0x3F3C, 0x0034, 0xA88F);
  150. extern pascal OSErr AcceptHighLevelEvent(TargetID *sender, unsigned long *msgRefcon, Ptr msgBuff, unsigned long *msgLen)
  151.  THREEWORDINLINE(0x3F3C, 0x0033, 0xA88F);
  152. extern pascal OSErr GetProcessSerialNumberFromPortName(const PPCPortRec *portName, ProcessSerialNumber *pPSN)
  153.  THREEWORDINLINE(0x3F3C, 0x0035, 0xA88F);
  154. extern pascal OSErr GetPortNameFromProcessSerialNumber(PPCPortRec *portName, const ProcessSerialNumber *pPSN)
  155.  THREEWORDINLINE(0x3F3C, 0x0046, 0xA88F);
  156. extern pascal Boolean GetSpecificHighLevelEvent(GetSpecificFilterUPP aFilter, void *yourDataPtr, OSErr *err)
  157.  THREEWORDINLINE(0x3F3C, 0x0045, 0xA88F);
  158.  
  159. #if PRAGMA_IMPORT_SUPPORTED
  160. #pragma import off
  161. #endif
  162.  
  163. #if PRAGMA_ALIGN_SUPPORTED
  164. #pragma options align=reset
  165. #endif
  166.  
  167. #ifdef __cplusplus
  168. }
  169. #endif
  170.  
  171. #endif /* __EPPC__ */
  172.